package cn.sunxyz.methodinference.rule;

import java.util.Collection;
import java.util.HashSet;

/**
 * Created by yangrd on 2017/5/27.
 */
public final class MethodRule {

    private MethodRule() {
    }

    private static String[] SELECT_PREFIX = {
            "GET", "FIND", "QUERY"
    };
    private static String[] DELETE_PREFIX = {
            "DELETE", "REMOVE"
    };
    private static final Collection<String> METHOD_PREFIX = new HashSet<>();

    static {
        regMethodPrefix(SELECT_PREFIX);
        regMethodPrefix(DELETE_PREFIX);
    }

    private static void regMethodPrefix(String[] prefixArray) {
        for (String prefix : prefixArray) {
            METHOD_PREFIX.add(prefix);
        }
    }

    public static boolean contains(String str){
        return METHOD_PREFIX.contains(str);
    }

    public static Collection<String> getMethodPrefix() {
        return METHOD_PREFIX;
    }
}
